package com.example.orderservice.feign;

import com.example.communservice.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
//这里注解括号内，是你要赋能此接口向nacos注册的服务名称
@FeignClient(value = "user-service",fallback = UserFeignHystrixImpl.class)
public interface UserFeign {
    //这里采用springMVC的接口风格赋能方法，使得这个方法已经变成了服务生产者
    @GetMapping("user/getUserById")
    User getUserById(@RequestParam("userId") Integer userId);
}
